package com.zxy.health.service;

import com.zxy.health.dao.ManagerDao;
import com.zxy.health.mapper.ManagerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ManagerService {
    @Autowired
    ManagerMapper managerMapper;

    public String login(String username,String password){
        ManagerDao managerDao = new ManagerDao();
        managerDao = managerMapper.login(username,password);
        if (managerDao.getRole()==2){
            return "managerTeacher";
        }else if (managerDao.getRole()==3){
            return "manager";
        }else if(managerDao.getRole()==1){
            return "main";
        }else {
            return "账号密码错误";
        }
    }

}
